package com.java80.springmall.cloud.product.provider.repository;


import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.java80.springmall.cloud.product.provider.entity.Product;

@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
	@Modifying
	@Transactional
	@Query(value = "update product set count=count+?2 where id=?1",nativeQuery = true)
	public int updateStored(long productId,int nums);
}
